<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>后台管理</title>
{{include file="layouts/_head"}}
<style type="text/css">
.set_menu a {
    font-weight: 600;
}
.set_menu a:hover {
    color: #777 !important;
}
.set_menu a:visited {
    color: #777 !important;
}
.set_menu li.active a {
    color: #333 !important;
}
</style>
</head>
<body>
<div class="main">
	<ol class="breadcrumb">
		<li><i class="icon_home iconfont"></i>首页</li>
	  	<li>设置中心</li>
	  	<li class="active">系统设置</li>
	</ol>
	<div class="bg-danger clearfix main-head-info error-info"></div>
	<nav class="navbar navbar-default set_menu">
        <ul class="nav navbar-nav">
            <li><a href="{{:url('/admin/set/system')}}">基础配置</a></li>
            <li><a href="{{:url('/admin/set/payment')}}?id=1">支付方式</a></li>
            <li class="active"><a href="{{:url('/admin/set/oauth')}}?id=qq">互联登录</a></li>
            <li><a href="{{:url('/admin/set/sms')}}">短信设置</a></li>
            <li><a href="{{:url('/admin/set/mail')}}">邮件设置</a></li>
            <li><a href="{{:url('/admin/set/client')}}?id=wx_app">应用配置</a></li>
        </ul>
    </nav>
	<div class="main-con">
		<ul class="nav nav-tabs" >
            <li {{if Request()->id == 'qq'}}class="active"{{/if}}><a href="{{:url('/admin/set/oauth')}}?id=qq">QQ登录</a></li>
            <li {{if Request()->id == 'weibo'}}class="active"{{/if}}><a href="{{:url('/admin/set/oauth')}}?id=weibo">微博登录</a></li>
            <li {{if Request()->id == 'weixin'}}class="active"{{/if}}><a href="{{:url('/admin/set/oauth')}}?id=weixin">微信登录</a></li>
        </ul>
		<form class="form-horizontal margin-t-30" id="form" method="post" action="{{:url('/admin/set/oauth')}}">
			<input type="hidden" name="id" value="{{:Request()->id}}">
		  	<div class="tab-box">
			  	<div class="form-group">
			    	<span class="col-sm-2 control-label">名字：</span>
			    	<div class="col-sm-8 input-group">
			    		<p class="form-control-static">{{$oauth.name}}</p>
			    	</div>
			  	</div>
			  	<div class="form-group">
			    	<span class="col-sm-2 control-label">Logo：</span>
			    	<div class="col-sm-8 input-group">
			    		<p class="form-control-static"><img src="{{$oauth.logo}}" style="width: 25px; height: 25px;"></p>
			    	</div>
			  	</div>
                <div class="form-group">
			    	<span class="col-sm-2 control-label">appid：</span>
				    <div class="col-sm-8 input-group">
				      <input class="form-control" name="appid" value="{{$oauth.appid}}">
				    </div>
			  	</div>
			  	<div class="form-group">
			    	<span class="col-sm-2 control-label">appkey：</span>
				    <div class="col-sm-8 input-group">
				      <input class="form-control" name="appkey" value="{{$oauth.appkey}}">
				    </div>
			  	</div>
				<div class="form-group">
				    <span class="col-sm-2 control-label">状态：</span>
				    <div class="col-sm-2 input-group">
					<select class="form-control" name="status">
						<option value="1" {{if $oauth.status == 1}}selected="true"{{/if}}>开启</option>
                        <option value="0" {{if $oauth.status == '0'}}selected="true"{{/if}}>关闭</option>
					</select>
				    </div>
				</div>
			</div>
			<div class="foot_btn_blank"></div>
            <div class="foot_btn">
                <div class="box">
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </div>
		</form>
	</div>
</div>
{{include file="layouts/_foot"}}
{{include file="shared/_jquery_validation"}}
<script type="text/javascript">
$("#form").validate({
	submitHandler:function(){
		layer.confirm('确认提交？', function() {
			layer.closeAll(); var load = layer.load();
			$("#form").ajaxSubmit(function(res) {
				layer.close(load);
                if (res.code == 401) {
                    goLogin(); return false;
                }
                if (res.code == 200) {
                    layer.msg('提交成功', { time: 1500 }, function () { window.location.reload(); });
                } else if (res.code == 400) {
                    layer.msg(res.message); return false;
                } else {
                    layer.msg('操作失败'); return false;
                }
			});
		});	
	}
});
</script>
</body>
</html>